package ${basepackage}.mapper.op;

import java.util.List;

import ${basepackage}.model.criteria.op.RoleCriteria;

import ${basepackage}.model.po.op.Role;
import ${basepackage}.model.po.op.UserRole;

import org.apache.ibatis.annotations.Param;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;

/**
 * @author "Jiance Qin"
 * 
 * @date 2014年2月24日
 * 
 * @time 下午12:07:33
 * 
 */
public interface RoleMapper {

	public Role get(Long id);

	public List<Role> getAll();

	public void remove(Long id);

	public Long insert(Role role);

	public Integer update(Role role);

	public PageList<Role> getList(@Param("criteria") RoleCriteria criteria, PageBounds pageBounds);

	public Integer getCount(@Param("criteria") RoleCriteria criteria);
	
	public Role getByName(String name);

	public List<Role> getByUserId(Long userId);

	public Integer saveUserRole(UserRole userRole);

	public Integer deleteUserRole(UserRole userRole);

	public Integer deleteUserRoleByUserId(Long userId);

}
